﻿@using Telerik.Web.Mvc.UI
@model List<HotelMgr.Models.Customer>
@{
    ViewBag.Title = "Index";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<h2 style="text-align: center;font-size: 20px;font-weight:bolder;">顾客管理</h2>
@*<p>@Html.ActionLink("添加顾客","Create")</p>*@

@(Html.Telerik().Grid(Model)
.Name("Grid")
.DataKeys(key => key.Add(k => k.CustomerID))
.ToolBar(c=>c.Insert().ButtonType(GridButtonType.Image))
.DataBinding(binding => binding.Server()
        .Select("Select", "CustomerManager")
        .Insert("Insert", "CustomerManager")
        .Update("Save", "CustomerManager")
        .Delete("Delete", "CustomerManager")
    )
.Columns(columns=>
             {
                 columns.Bound(c=>c.Name);
                 columns.Bound(c=>c.IDCard);
                 columns.Bound(c=>c.Sex);
                 columns.Bound(c=>c.Phone);
                 columns.Bound(c=>c.Comment);
                @* columns.Template(@<text>
                                       @Html.ActionLink("修改", "Edit", "CustomerManager", new {id = item.CustomerID}, null)
                                       @Html.ActionLink("删除", "Delete", "CustomerManager", new {id = item.CustomerID}, null)
                                       @Html.ActionLink("详细","Details","CustomerManager",new{id=item.CustomerID},null)
                                   </text>).Title("操作");*@
                 columns.Command(c =>
                                     {
                                         c.Edit().ButtonType(GridButtonType.Image);
                                         c.Delete().ButtonType(GridButtonType.Image);
                                     }).Title("操作");
                 
             })
             .Editable(e => e.Mode(GridEditMode.InLine))
             .Pageable()
             .Scrollable(i=>i.Enabled(true))
             .Footer(true))
